%module heroengine
%include "std_vector.i"
%{
#include "heroz.hh"
%}


struct ScreenCharacters {
  unsigned char s[SCREENHEIGHT][SCREENWIDTH + 1]; //The 41th Byte should be a LF...

  void set(unsigned int x, unsigned int y, char c);
  unsigned char get(unsigned int x, unsigned int y);
  unsigned char get_save(unsigned int x, unsigned int y, unsigned char c = ' ');
  void clear(unsigned char c = ' ');
  void shift_left();
  void shift_right();
  void shift_up();
  void shift_down();
};


struct HeroZ {
  std::vector<ScreenCharacters> screens;
  SDL_Surface *display;
  HFont *font;
  HerozGraphics *gfx;
  HeroBasic *basic;
  short infopos;
  unsigned char *memory;
  ScreenCharacters *screen;
  std::vector<Mix_Music *> muzaks;
  Input *input;
  float px, py, pdx, pdy; //player x, y, delta x, deltay
  Levels *levels;
  Uint32 last_ticks;
  float mvmr; //!< movement rate in s
  SDL_Thread *display_thread;
  SDL_Surface *screen_buffer;
  int quit; //!< general signal for all threads, etc. to quit is set
	    //to anything else than zero.
  uint32_t displayed_frame_number;
};


void play_the_game(HeroZ *heroz);
HeroZ *init_engine(const char *path);
void init_threads(HeroZ *heroz);
void clean_up(HeroZ *heroz);
